﻿using System;
using UnityEngine;

public class ShakeCameraOnEnable : MonoBehaviour
{
    public float decay = 0.02f;
    public float intensity = 0.1f;

    private void OnEnable()
    {
        float num = 1f;
        if (PlayerCharacter.local != null)
        {
            num = Mathf.Max(Vector3.Distance(PlayerCharacter.local.position, base.transform.position), 1f);
        }
        CameraShake.ShakeMainCamera(this.intensity * (1f / num), this.decay);
    }
}

